package me.flyray.crm.core.modules.netty.handlers;


import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import me.flyray.crm.core.modules.netty.entity.SolidLock;


/** 
* @description：锁类型
*/

public class LocksMap {
	
	private static Map<String,SolidLock> map = new ConcurrentHashMap<String, SolidLock>();
	  public static void add(String lockId,SolidLock object){
	        map.put(lockId,object);
	    }
 
	    public static SolidLock get(String lockId){
	       return map.get(lockId);
	    }
 
	    public static void remove(SolidLock object){
	        for (Map.Entry entry:map.entrySet()){
	            if (entry.getValue()==object){
	                map.remove(entry.getKey());
	            }
	        }
	    }
 
}

